package com.xujie.sportsmeeting.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.*;
import java.time.LocalDateTime;

/**
 * 比赛项目DTO
 */
@Data
@Schema(description = "比赛项目DTO")
public class EventDTO {
    
    @Schema(description = "项目名称")
    @NotBlank(message = "项目名称不能为空")
    @Size(min = 2, max = 50, message = "项目名称长度必须在2-50个字符之间")
    private String eventName;
    
    @Schema(description = "项目编码")
    @NotBlank(message = "项目编码不能为空")
    @Size(min = 2, max = 20, message = "项目编码长度必须在2-20个字符之间")
    private String eventCode;
    
    @Schema(description = "项目类型：1-个人项目，2-团体项目")
    @NotNull(message = "项目类型不能为空")
    @Min(value = 1, message = "项目类型值错误")
    @Max(value = 2, message = "项目类型值错误")
    private Integer eventType;
    
    @Schema(description = "性别限制：0-不限，1-男子，2-女子")
    @NotNull(message = "性别限制不能为空")
    @Min(value = 0, message = "性别限制值错误")
    @Max(value = 2, message = "性别限制值错误")
    private Integer genderLimit;
    
    @Schema(description = "年龄分组")
    @Size(max = 50, message = "年龄分组长度不能超过50个字符")
    private String ageGroup;
    
    @Schema(description = "最大参赛人数")
    @NotNull(message = "最大参赛人数不能为空")
    @Min(value = 1, message = "最大参赛人数不能小于1")
    @Max(value = 1000, message = "最大参赛人数不能超过1000")
    private Integer maxParticipants;
    
    @Schema(description = "项目描述")
    @Size(max = 500, message = "项目描述长度不能超过500个字符")
    private String description;
    
    @Schema(description = "比赛规则")
    @Size(max = 1000, message = "比赛规则长度不能超过1000个字符")
    private String rules;
    
    @Schema(description = "计分方式")
    @Size(max = 50, message = "计分方式长度不能超过50个字符")
    private String scoringMethod;
    
    @Schema(description = "成绩单位")
    @Size(max = 20, message = "成绩单位长度不能超过20个字符")
    private String unit;
    
    @Schema(description = "比赛地点")
    @NotBlank(message = "比赛地点不能为空")
    @Size(max = 100, message = "比赛地点长度不能超过100个字符")
    private String venue;
    
    @Schema(description = "比赛时间")
    @NotNull(message = "比赛时间不能为空")
    private LocalDateTime competitionTime;
    
    @Schema(description = "比赛时长(分钟)")
    @Min(value = 1, message = "比赛时长不能小于1分钟")
    @Max(value = 1440, message = "比赛时长不能超过1440分钟")
    private Integer durationMinutes;
    
    @Schema(description = "报名开始时间")
    private LocalDateTime registrationStartTime;
    
    @Schema(description = "报名结束时间")
    private LocalDateTime registrationEndTime;
    
    @Schema(description = "状态：0-禁用，1-正常，2-报名中，3-比赛中，4-已结束")
    @NotNull(message = "状态不能为空")
    @Min(value = 0, message = "状态值错误")
    @Max(value = 4, message = "状态值错误")
    private Integer status;
}
